﻿using FriendStar.Code;
using FriendStar.Domain.Entity.BaseData;
using FriendStar.Domain.IRepository.BaseData;
using FriendStar.Repository.BaseData;
using System.Collections.Generic;
using System.Linq;
using SqlSugarRepository;

namespace FriendStar.Application.BaseData
{
    public class ZSJ_22_TP_PalletApp
    {
        private IZSJ_22_TP_PalletRepository service = new ZSJ_22_TP_PalletRepository();
        public List<ZSJ_22_TP_PalletEntity> GetList(string useUnit)
        {
            var expression = ExtLinq.True<ZSJ_22_TP_PalletEntity>();
            if (!string.IsNullOrEmpty(useUnit))
            {
                expression = expression.And(t => t.UseUnit.Contains(useUnit));
            }
            return service.IQueryable(expression).Select( p=>new ZSJ_22_TP_PalletEntity(){PalletNO=p.PalletNO,PalletNOName=p.PalletNOName}).OrderBy(t => t.PalletNO).ToList();
        }
    }
}